get bkgnd field "Index" of prev card --index page #'s
add 1 to it
put it into bkgnd field "Index" of this card
end newCard
on openCard
set the cursor to 4
--Keep pages orderly
if the number of card buttons = 33 then
answer "Please move the extra button to a new page."
else
if the number of card buttons > 33 then
answer "Please move extra buttons to a new page."
end if
end if
set the cursor to 4
-- use this throwaway XCMD to place buttons on grid on card
-- written for increased speed only
put 9 into basex
put 38 into basey
put 54 into offs
SortButtons (the number of card buttons),basex,basey,offs
end openCard
-- part 1 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=454 top=291 right=307 bottom=470
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Next
----- HyperTalk script -----
on mouseUp
visual effect wipe left to black
visual effect dissolve very fast to white
go to next card in this background
end mouseUp
-- part 2 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=469 top=306 right=322 bottom=485
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Prev
----- HyperTalk script -----
on mouseUp
visual effect wipe right to black
visual effect dissolve very fast to white
go to prev card in this background
end mouseUp
-- part 5 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=456 top=29 right=46 bottom=482
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Index
-- part 6 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=399 top=26 right=47 bottom=422
-- title width / last selected line: 0
-- icon id / first selected line: 21847 / 21847
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Home
----- HyperTalk script -----
on mouseUp
visual effect iris close
go home
end mouseUp
-- part 7 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=42 top=287 right=320 bottom=74
-- title width / last selected line: 0
-- icon id / first selected line: 21453 / 21453
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Add Box
----- HyperTalk script -----
-- create a file for a particular disk box
on mouseUp
if the number of card buttons > 31 then
answer "Please create a new page."
exit mouseUp
end if
-- name the file acceptably
put false into goodOne
repeat until goodOne
-- default is sequentially numbered box
ask "Please enter box name: " with "Box #"&((the number of card buttons+1)+((bkgnd field "Index"-1)*32))
If it is empty then
exit mouseUp
--make the name < 10 characters
else
if the length of it < 10 then
put it into boxName
put true into goodOne
else
repeat until goodOne
beep
ask "Please enter box name (<10 char.): " with "Box #"&((the number of card buttons+1)+((bkgnd field "Index"-1)*32))
if it is empty then
exit mouseUp
else
if the length of it < 10 then
put it into boxName
put true into goodOne
end if
end if
end repeat
end if
end if
end repeat
-- make a box button aimed at the new file
set lockScreen to true
choose button tool
doMenu New Button
set icon of button "New Button" to 24438 -- a disk box icon
set autoHilite of btn "New Button" to TRUE
set style of button "New Button" to transparent
set rect of button "New Button" to 219,142,274,197 -- stick in middle
set name of button "New Button" to boxName
-- a hidden button that holds the generic script for the box
-- buttons which point to the appropriate file (cards)
get script of bkgnd button id 17
put it into scriptHolder
-- stick the generic script & the right pointer into the new button
set script of button boxName to "on mouseUp"&return &"global hardDisk" &return&"put"&"e&boxName&&1"e&&"into cardNm"&return&"put" &"e&boxName&".Index""e&&"into indCardNm"&return&"put" &"e&boxName"e&&"into boxName"&return&"put false into hardDisk" &return&return&scriptHolder
send openCard to this card
choose browse tool
set lockScreen to false
end mouseUp
-- part 13 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=302 top=32 right=57 bottom=333
-- title width / last selected line: 0
-- icon id / first selected line: 19678 / 19678
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Tell Me...
----- HyperTalk script -----
on mouseUp
push card
visual effect dissolve
go to card id 7767
end mouseUp
-- part 11 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=30 top=36 right=54 bottom=53
-- title width / last selected line: 0
-- icon id / first selected line: 6720 / 6720
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Return
----- HyperTalk script -----
on mouseUp
visual effect iris close
pop card
end mouseUp
-- part 17 (button)
-- low flags: 80
-- high flags: 0000
-- rect: left=159 top=37 right=49 bottom=171
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: HoldTheScript
----- HyperTalk script -----
--generic button script
put false into flag
put the ticks into originalTicks
repeat until the mouseClick -- flag a single click
if the ticks - originalTicks > 30 then
put true into flag -- single click
exit repeat
end if
end repeat
visual effect iris open
--begin with creating a box index card
set cursor to 4
put the ID of this card into toHome -- store this index card
put false into frstCrd
if flag contains false then -- double click
go to card CardNm -- first disk catalog card of box
if the result is not empty then
go to card indCardNm
end if
else -- single click
go to card indCardNm -- box index card
end if
if the result is not empty then
put true into frstCrd -- they don't exist yet
set lockMessages to true
set lockScreen to true
go to card id 5366 -- box index template
doMenu New Card
set the name of this card to indCardNm
put boxName into bkgnd field "Box Name"
put third word of toHome into bkgnd field "IndexCardID" -- index card
if hardDisk contains true then
put "true" into bkgnd field "Hard Disk?" -- floppy or HD box
else
put "false" into bkgnd field "Hard Disk?"
end if
set lockMessages to false
end if
--create and go to first disk card if this is a new box
if frstCrd contains true then
-- start a new set of cards for the box
go to card cardNm
if the result is not empty then
set lockMessages to true
go to card id 3043
doMenu New Card
set the name of this card to cardNm
put word 1 to (the number of words in cardNm -1) of cardNm into bkgnd field "Box Name" of card cardNm -- index which box
put 1 into bkgnd field "PageOfBox" of card cardNm -- which disk number
-- which Index Box
put indCardNm into bkgnd field "Box Card" of card cardNm
if hardDisk contains true then -- Hard Disk?
put "true" into bkgnd field "Hard Disk?"
put "Page#:" into bkgnd field "Name Of Page"
else
put "false" into bkgnd field "Hard Disk?"
put "Disk#:" into bkgnd field "Name Of Page"
end if
-- create an opaque button to cover up the arrow pointing to previous
-- card since this is the first disk catalog page and there will be no
-- previous disk catalog page
doMenu New Button
set rect of button "New Button" to 159,313,185,336
set style of button "New Button" to opaque
set showName of button "New Button" to false
set name of button "New Button" to "Cover Prev"
choose browse tool
set lockScreen to false
go to card cardNm
--call ReadAutoCat
send openCard to card cardNm
end if
end if
end mouseUp
-- part 18 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=239 top=288 right=321 bottom=269
-- title width / last selected line: 0
-- icon id / first selected line: 30527 / 30527
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Find
----- HyperTalk script -----
on mouseUp
searchAC 1 -- XFCN to bring up dialog box to set Find parameters
end mouseUp
-- part 26 (button)
-- low flags: 00
-- high flags: 2000
-- rect: left=86 top=286 right=320 bottom=122
-- title width / last selected line: 0
-- icon id / first selected line: 24342 / 24342
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Add Box
----- HyperTalk script -----
-- create a file for a particular disk box
on mouseUp
if the number of card buttons > 31 then
answer "Please create a new page."
exit mouseUp
end if
-- name the file acceptably
put false into goodOne
repeat until goodOne
-- default is sequentially numbered box name
ask "Please enter box name: " with "Box #"&((the number of card buttons+1)+((bkgnd field "Index"-1)*32))
If it is empty then
exit mouseUp
else
-- make name < 10 characters
if the length of it < 10 then
put it into boxName
put true into goodOne
else
repeat until goodOne
beep
ask "Please enter box name (<10 char.): " with "Box #"&((the number of card buttons+1)+((bkgnd field "Index"-1)*32))
if it is empty then
exit mouseUp
else
if the length of it < 10 then
put it into boxName
put true into goodOne
end if
end if
end repeat
end if
end if
end repeat
-- make a box button aimed at the new file
set lockScreen to true
choose button tool
doMenu New Button
set icon of button "New Button" to 23929 -- a hard disk box icon
set autoHilite of btn "New Button" to TRUE
set style of button "New Button" to transparent
set rect of button "New Button" to 219,142,274,197 -- stick in middle
set name of button "New Button" to boxName
-- a hidden button that holds the generic script for the box
-- buttons which point to the appropriate file (cards)
get script of bkgnd button id 17
put it into scriptHolder
-- stick the generic script & the right pointer into the new button
set script of button boxName to "on mouseUp"&return &"global hardDisk" &return&"put"&"e&boxName&&1"e&&"into cardNm"&return&"put" &"e&boxName&".Index""e&&"into indCardNm"&return&"put" &"e&boxName"e&&"into boxName"&return&"put true into hardDisk" &return&return&scriptHolder